package com.example.converter.enums;

public enum VideoTypeEnum {
    //'电影类型 0 其他 1 动画 2 恐怖 3 爱情 4 动作 5 喜剧',
    ELSE(0,"其他类型"),
    CARTOON(1, "动画"),
    DRACULA(2, "恐怖"),
    LOVE(3, "爱情"),
    ACTION(4, "动作"),
    COMEDY(5, "喜剧");

    private int id;
    private String type;

    VideoTypeEnum() {
    }


    VideoTypeEnum(int i, String s) {
        this.id = i;
        this.type = s;
    }

    public int getId() {
        return id;
    }

    public String getType() {
        return type;
    }

    /**
     * 根据id返回前端的VideoTypeEnum
     * @param id
     * @return
     */
    public static VideoTypeEnum getEnumById(int id){
        switch (id){
            case 1:
                return VideoTypeEnum.CARTOON;
            case 2:
                return VideoTypeEnum.DRACULA;
            case 3:
                return VideoTypeEnum.LOVE;
            case 4:
                return VideoTypeEnum.ACTION;
            case 5:
                return VideoTypeEnum.COMEDY;
            default:
                return VideoTypeEnum.ELSE;
        }
    }
}

